

import java.sql.*;
import com.mysql.jdbc.*;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.sql.DriverManager;


public class jdbc {
	static final String jdbc_driver="com.mysql.jdbc.Driver";
	static final String db_url="jdbc:mysql://localhost/tukudu";
	static final String user="root";
	static final String pass="felightrocks";
	
	
	static Connection conn=null;
	static Statement stmt=null;
	ResultSet rs=null;
	
	public static void main(String[] args) {
		
		try {
			Class.forName("com.mysql.jdbc.Driver");
			Connection conn = (Connection) DriverManager.getConnection(db_url,user,pass);
			Statement stmt=(Statement) conn.createStatement();
			ResultSet rs=stmt.executeQuery("SELECT * FROM EMPLOYEE");
			
			while(rs.next()){
				System.out.println(rs.getInt(1));
				System.out.println(rs.getString(3));
				
			}
			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		finally{
			try{
			if(conn!=null)
				conn.close();
			if(stmt!=null)
				stmt.close();
			}
			catch(SQLException se){
				se.printStackTrace();
			}
		}
		

	}

}

